<template>
  <div>
    <el-form inline style="margin: 20px">
      <el-form-item
        ><el-input placeholder="点击输入医院名称" v-model="yiyuanname"></el-input
      ></el-form-item>
      <el-form-item
        ><el-date-picker v-model="value" type="date" placeholder="选择日期">
        </el-date-picker
      ></el-form-item>
      <el-form-item
        ><el-date-picker
          v-model="value1"
          type="date"
          placeholder="选择截止日期"
        >
        </el-date-picker
      ></el-form-item>
      <el-form-item
        ><el-button type="primary" icon="el-icon-search"
          >查询</el-button
        ></el-form-item
      >
    </el-form>
    <div ref="echer" style="height: 500px;"></div>
  </div>
</template>

<script>
import { reqshuju } from "@/api/order";
import * as echarts from "echarts";
export default {
  name: "Order",
  data() {
    return {
      value1: null,
      value: null,
      dateList:[],
      countList:[],
      yiyuanname:''

    };
  },
  methods: {
    async getshuju() {
      try {
        const re = await reqshuju();
        console.log(re);
        this.dateList=re.data.dateList
        this.countList=re.data.countList



        console.log(this.$refs.echer);
    let myecharts = echarts.init(this.$refs.echer);
    const option = {
      xAxis: {
        type: "category",
        data: this.dateList,
      },
      yAxis: {
        type: "value",
        data:[0,50,100,150,200,250]
      },
      series: [
        {
          data: this.countList,
          type: "line",
        },
      ],
    };
    myecharts.setOption(option)
      } catch (e) {}
    },
  },
  mounted() {
    this.getshuju();

  },
};
</script>

<style lang="less" scoped></style>
